{extend name="../../admin/view/main"}

{block name='content'}

<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body padding-left-40">

        <div class="hr-line-dashed margin-top-10 margin-bottom-10"></div>
        <div class="layui-row layui-col-space15">
            <div class="layui-col-xs4">
                <label class="relative block">
                    <span class="color-green font-w7">用户ID</span><span class="color-desc margin-left-5">ID</span>
                    <input disabled value='{$vo.id}' class="layui-input">
                </label>
            </div>
        </div>

        <div class="layui-row layui-col-space15">
            <div class="layui-col-xs5">
                <label class="block relative">
                    <span class="color-green font-w7">司机姓名</span>
                    <span class="color-desc margin-left-5">User Name</span>
                    <input name="nickname" value='{$vo.nickname|default=""}' class="layui-input ">
                    <span class="help-block">显示的司机姓名</span>
                </label>
            </div>
            <div class="layui-col-xs5">
                <label class="block relative">
                    <span class="color-green font-w7">手机号码</span>
                    <span class="color-desc margin-left-5">Contact Mobile</span>
                    <input type="tel" maxlength="11" name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入手机号码" class="layui-input">
                    <span class="help-block">手机号码，请尽量保持不要重复</span>
                </label>
            </div>
        </div>

        <div class="layui-row layui-col-space15">
            <span class="color-green font-w7 label-required-prev">所在区域</span>
            <span class="color-desc margin-left-5">（原区域：{$vo.region_province|default='--'} - {$vo.region_city|default=''} - {$vo.region_area|default=''} ）</span>
            <div class="layui-row layui-col-space10">
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="province" name="region_province"></select></label>
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="city" name="region_city"></select></label>
                <label class="layui-col-xs4"><select class="layui-select" lay-filter="area" name="region_area"></select></label>
            </div>
        </div>


        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

        <div class="layui-form-item text-center">
            <button class="layui-btn" type='submit'>保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-history-back data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>
    </div>
</form>

{/block}
{block name='script'}

<script>
    /*! 表单初始化 */
    window.form.render();

    /*! 表单初始化 */
    require(['pcasunzips'], function () {
        (function (prov, city, area, refresh) {
            new PCAS("region_province", "region_city", "region_area", prov, city, area);
            refresh(), form.on('select(province)', refresh), form.on('select(city)', refresh), form.on('select(area)', refresh);
        })("{$vo.region_province}", "{$vo.region_city}", "{$vo.region_area}", function (data) {
            (data && $(data.elem).trigger('change')), setTimeout(function () {
                layui.form.render();
            }, 100);
        });
    });
</script>
{/block}
